Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theme JSON: add global block gap css vars #2038

Conversation

ramonjd
Copy link
Member

@ramonjd ramonjd commented Dec 10, 2021

Initial commit to test how and where to manipulate the style declarations for block gap.

See: WordPress/gutenberg#35454

Trac ticket:


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

}
}

if ( ! empty( $declarations_block_gap ) ) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the first attempt, which will be the worst attempt.

Just getting things to work as expected before refactoring.

@oandregal
Copy link
Member

I commented at WordPress/gutenberg#35454 (comment) asking whether this was for WordPress 5.9 or 6.0. If it's the later, we shouldn't port this just yet.

@ramonjd
Copy link
Member Author

ramonjd commented Dec 12, 2021

I commented at WordPress/gutenberg#35454 (comment) asking whether this was for WordPress 5.9 or 6.0. If it's the later, we shouldn't port this just yet.

Thanks a lot @oandregal !!

I was just experimenting here, trying to find the best point which we could filter the block class declarations.

My hope was to only add something like this in wp-theme-json

apply_filters( 'gutenberg_block_classes_declarations', $declarations )

and move the logic to the plugin.

I am in no way certain that's the right way forward yet so I would be very glad to hear your advice. 😄

@oandregal
Copy link
Member

I don't think we want to add low-level filters at the moment. We discussed adding a couple of high-level ones at WordPress/gutenberg#36909 but decided against it.

@ramonjd ramonjd closed this Mar 24, 2022
@ramonjd ramonjd deleted the try/theme-json-generate-spacing-gap-css-vars branch March 24, 2022 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants